﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace CadlineRegistration
{
    public partial class FormRegistrazione : Form
    {
        public FormRegistrazione()
        {
            InitializeComponent();
        }

        public void bindUserInfo(UserInfo ui)
        {
            txtnome.DataBindings.Clear();
            txtnome.DataBindings.Add(new Binding("Text",ui,"Nome"));

            txtcognome.DataBindings.Clear();
            txtcognome.DataBindings.Add(new Binding("Text", ui, "Cognome"));

            txtragsoc.DataBindings.Clear();
            txtragsoc.DataBindings.Add(new Binding("Text", ui, "RagioneSociale"));

            txtprofessione.DataBindings.Clear();
            txtprofessione.DataBindings.Add(new Binding("Text", ui, "Professione"));

            txtlocalita.DataBindings.Clear();
            txtlocalita.DataBindings.Add(new Binding("Text", ui, "Localita"));

            txtcap.DataBindings.Clear();
            txtcap.DataBindings.Add(new Binding("Text", ui, "Cap"));

            txtprovincia.DataBindings.Clear();
            txtprovincia.DataBindings.Add(new Binding("Text", ui, "Provincia"));

            txttel.DataBindings.Clear();
            txttel.DataBindings.Add(new Binding("Text", ui, "Telefono"));

            txtmail.DataBindings.Clear();
            txtmail.DataBindings.Add(new Binding("Text", ui, "Mail"));

            txtmailconfirm.DataBindings.Clear();
            txtmailconfirm.DataBindings.Add(new Binding("Text", ui, "ConfirmMail"));

            txtcell.DataBindings.Clear();
            txtcell.DataBindings.Add(new Binding("Text", ui, "Cellulare"));
        }
    }
}
